package com.google.code.netbuilder.dal.entities;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Temporal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

@XmlType(propOrder = {"cableId", "wireId"}, 
                         name = "CableWire")
@XmlAccessorType(XmlAccessType.FIELD)
@Entity
@Table(name = "cable_wire")
@SequenceGenerator(name="seq", initialValue=1, allocationSize=100)
public class CableWire {

        @Id
        @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq")
        Integer id;
        @Column(name="id_cable")
	Integer cableId;
        @Column(name="id_wire")
	Integer wireId;
        @Temporal(javax.persistence.TemporalType.DATE)
	Date date;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
	public Date getDate() {
		return date;
	}

	public void setDate(long millisecond) {
		this.date = new Date(millisecond);
	}
	
	public void setDate(Date date) {
		this.date = date;
	}

	public Integer getCableId() {
		return cableId;
	}

	public void setCableId(Integer cableId) {
		this.cableId = cableId;
	}

	public Integer getWireId() {
		return wireId;
	}

	public void setWireId(Integer wireId) {
		this.wireId = wireId;
	}

}
